from sklearn.linear_model import LogisticRegression
from sklearn.datasets import load_breast_cancer
from sklearn.metrics import confusion_matrix,accuracy_score,precision_score,f1_score
import warnings
warnings.filterwarnings('ignore')
data=load_breast_cancer()
x=data.data
y=data.target
# penalty:惩罚项   l1正则  l2正则
#C: 正则惩罚项系数
lr=LogisticRegression(penalty='l2',C=3)
lr.fit(x,y)
h=lr.predict(x)

print(confusion_matrix(y,h))
print(accuracy_score(y,h))
print(precision_score(y,h))
print(f1_score(y,h))